// 导入request.js 工具
import request from "@/utils/request";

export const ExcelDownloadService = () => {
  return request({
    url: "/excel/download",
    method: 'get',
    responseType: 'blob' // 设置响应类型为blob
  });
};

export const ExcelUploadService = (file) => {
  const formData = new FormData();
  formData.append('file', file);
  return request({
    url: "/excel/upload",
    method: 'post',
    data: formData, // 使用 data 而不是 formData
    headers: {
      'Content-Type': undefined // 让 axios 自动设置 Content-Type
    }
  });
};